Image encoding apparatus and method, program code, and storage medium

ABSTRACT

Image data is decomposed into subbands and quantized by a discrete wavelet transformer ( 102 ) and coefficient quantizer ( 103 ). On the other hand, a high-resolution region information input unit ( 105 ) inputs region designation information H(x, y) that designates a region which requires a high resolution, and a mask generator ( 106 ) obtains, based on H(x, y), mask information M(S, x, y) indicating if coefficients of HL2, LH2, and HH2 are generated with reference to pixels of the high-resolution region. A coefficient correction unit ( 104 ) corrects the quantized coefficients of respective subbands with reference to M(S, x, y) if subband S is one of HL2, LH2, and HH2, and does not correct if subband S is other than HL2, LH2, and HH2.

FIELD OF THE INVENTION

[0001] The present invention relates to an image encoding apparatus and method for encoding image data, a program, and a storage medium.

BACKGROUND OF THE INVENTION

[0002] In recent years, as the technologies for image input apparatuses such as digital cameras, scanners, and the like have improved, the resolution of image data captured by such input apparatus is increasing. A low-resolution image requires only a small image data size and never disturbs transfer and storage processes. However, the image data size becomes huge with increasing resolution, thus requiring a long transfer time and a large storage size.

[0003] Hence, upon transferring or storing an image, it is a common practice to remove redundancy of an image or to reduce the data size by processing an image within a visibly allowable range using high-efficiency coding. A coding scheme that can perfectly reconstruct an original image by decoding is called lossless coding, and a coding scheme which can obtain a visibly approximate image, but cannot perfectly reconstruct an original image is called lossy coding. In case of lossy coding, it is important to reduce the code size by changing a portion where slight deterioration is visibly inconspicuous, but such process largely depends on the characteristics of images. Image data includes various types: a natural image generated by taking a silver halide photo of a person, landscape, or the like, and scanning the photo using a scanner, or directly taking such object photo by a digital camera, a text/line image obtained by rasterizing text/line information, a CG image obtained by rendering two-dimensional image data or a three-dimensional shape generated by a computer, and the like. In order to obtain high reproduced image quality, the required resolution and the required number of gray levels vary depending on such image types. In general, a text/line image requires a higher resolution than a natural image.

[0004] As one conventional scheme of high-efficiency coding, a method using wavelet transformation is used. In the conventional scheme, an image to be encoded is decomposed into a plurality of frequency bands (subbands) using discrete wavelet transformation. Transform coefficients of respective subbands undergo quantization and entropy coding by various methods to generate a code sequence. As a wavelet transformation method of an image, as shown in FIGS. 4A, 4B, and 4C that show its processes, an image to be encoded (FIG. 4A) undergoes a one-dimensional transformation process in the horizontal and vertical directions to be decomposed into four subbands. Furthermore, a method of repetitively decomposing only a low-frequency subband (LL subband) is normally used. FIG. 5 shows an example of subbands obtained when one-dimensional transformation is repeated twice.

[0005] As one of merits of image coding using wavelet transformation, scalable decoding of spatial resolutions is easy to implement. When wavelet transformation is done, as shown in FIG. 5, and coefficients of respective subbands are encoded and transferred in turn from low-frequency subband LL toward high-frequency subband HH2, the decoding side can decode images while gradually increasing resolution, i.e., a reconstructed image of ¼ resolution upon receiving coefficients of LL subband, that of ½ resolution upon receiving LL, LH1, HL1, and HH1, and that of an original resolution upon additionally receiving LH2, HL2, and HH2.

[0006] However, the aforementioned conventional high-efficiency coding method is not so efficient since it does not consider that different resolutions are required to obtain a high-quality natural image and text/line image upon encoding image data that includes both a natural image and text/line image.

[0007] When an image includes portions having different required resolutions like in a text/photo mixed image, data required to decode high resolution for only a required region is encoded, and data required to decode high resolution for a region that does not require high resolution is discarded, using scalability of spatial resolution of wavelet transformation.

[0008] However, the aforementioned conventional high-efficiency coding method is not so efficient, since image data must be temporarily scanned at high resolution upon encoding image data which includes regions having different required resolutions such as an image that includes both a natural image and text/line image.

[0009] The present invention has been made in consideration of the aforementioned problems, and has as its object to implement efficient image coding upon encoding image data that include regions which require different resolution levels.

[0010] It is another object of the present invention to make encoding that generates a code sequence, which allows the decoding side to specify a resolution of interest early upon decoding encoded image data.

SUMMARY OF THE INVENTION

[0011] In order to achieve the object of the present invention, an image encoding apparatus of the present invention characterized by comprising:

[0012] region information generation means for generating region information which indicates a region of the image, that requires decoding at a higher resolution than other regions;

[0013] frequency transformation means for generating coefficients for respective subband by frequency transformation of the image;

[0014] correction means for correcting, in accordance with the region information, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by the frequency transformation means or quantized values of the coefficients; and

[0015] encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by the correction means to generate a code sequence.

[0016] In order to achieve the object of the present invention, an image encoding apparatus of the present invention characterized by comprising:

[0017] division means for dividing the image into tiles each having a predetermined size;

[0018] frequency transformation means for generating coefficients for respective subbands of a tile, divided by the division means, by frequency transformation of the tile;

[0019] discrimination means for generating a discrimination result indicating if each of the tiles divided by the division means includes a specific region;

[0020] correction means for correcting, in accordance with the discrimination result of the discrimination means, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by the frequency transformation means or quantized values of the coefficients; and

[0021] encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by the correction means to generate a code sequence.

[0022] In order to achieve the object of the present invention, an image encoding apparatus of the present invention characterized by comprising:

[0023] division means for dividing the image into tiles each having a predetermined size;

[0024] discrimination means for generating a discrimination result indicating if each of the tiles divided by the division means includes a specific region;

[0025] frequency transformation means for generating coefficients for respective subbands of a tile, divided by the division means, by frequency transform of the tile using a filter according to the discrimination result of the discrimination means;

[0026] correction means for correcting, in accordance with the discrimination result of the discrimination means, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by the frequency transformation means or quantized values of the coefficients; and

[0027] encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by the correction means to generate a code sequence.

[0028] In order to achieve the object of the present invention, an image encoding method of the present invention characterized by comprising:

[0029] the region information generation step of generating region information which indicates a region of the image, that requires decoding at a higher resolution than other regions;

[0030] the frequency transformation step of generating coefficients for respective subband by frequency transformation of the image;

[0031] the correction step of correcting, in accordance with the region information, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and

[0032] the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in the correction step to generate a code sequence.

[0033] the division step of dividing the image into tiles each having a predetermined size;

[0034] frequency transformation step of generating coefficients for respective subbands of a tile, divided in the division step, by frequency transformation of the tile;

[0035] the discrimination step of generating a discrimination result indicating if each of the tiles divided in the division step includes a specific region;

[0036] the correction step of correcting, in accordance with the discrimination result of the discrimination step, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and

[0037] the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in the correction step to generate a code sequence.

[0038] In order to achieve the object of the present invention, an image encoding method of the present invention characterized by comprising:

[0039] the division step of dividing the image into tiles each having a predetermined size;

[0040] frequency transformation step of generating coefficients for respective subbands of a tile, divided in the division step, by frequency transformation of the tile;

[0041] the discrimination step of generating a discrimination result indicating if each of the tiles divided in the division step includes a specific region;

[0042] the correction step of correcting, in accordance with the discrimination result of the discrimination step, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and

[0043] the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in the correction step to generate a code sequence.

[0044] In order to achieve the object of the present invention, an image encoding method of the present invention characterized by comprising:

[0045] the division step of dividing the image into tiles each having a predetermined size;

[0046] the discrimination step of generating a discrimination result indicating if each of the tiles divided in the division step includes a specific region;

[0047] the frequency transformation step of generating coefficients for respective subbands of a tile, divided in the division step, by frequency transform of the tile using a filter according to the discrimination result of the discrimination step;

[0048] the correction step of correcting, in accordance with the discrimination result of the discrimination step, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and

[0049] the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in the correction step to generate a code sequence.

[0050] In order to achieve the object of the present invention, an image encoding apparatus of the present invention characterized by comprising:

[0051] first scan means for scanning a first region of an original image at a first resolution to generate a first image including the scanned region;

[0052] second scan means for scanning a second region different from the first region at a second resolution higher than the first resolution to generate a second image including the scanned region;

[0053] first frequency transformation means for generating coefficients for respective subbands, by frequency transformation of the second image;

[0054] multiplexing means for multiplexing the first image in a predetermined one of a plurality of subbands obtained by the first frequency transformation means to generate a multiplexed subband;

[0055] second frequency transformation means for further generating coefficients for respective subbands, by frequency transformation of the multiplexed subband; and

[0056] code sequence generation means for generating a code sequence on the basis of the coefficients of the subbands obtained by the first and second frequency transformation means.

[0057] In order to achieve the object of the present invention, an image encoding method of the present invention characterized by comprising:

[0058] the first scan step of scanning a first region of an original image at a first resolution to generate a first image including the scanned region;

[0059] the second scan step of scanning a second region different from the first region at a second resolution higher than the first resolution to generate a second image including the scanned region;

[0060] the first frequency transformation step of generating coefficients for respective subbands, by frequency transformation of the second image;

[0061] the multiplexing step of multiplexing the first image in a predetermined one of a plurality of subbands obtained in the first frequency transformation step to generate a multiplexed subband;

[0062] the second frequency transformation step of further generating coefficients for respective subbands, by frequency transformation of the multiplexed subband; and

[0063] the code sequence generation step of generating a code sequence on the basis of the coefficients of the subbands obtained in the first and second frequency transformation steps.

[0064] Other features and advantages of the present invention will be apparent from the following descriptions taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0066]FIG. 1 is a block diagram showing the functional arrangement of an image encoding apparatus according to the first embodiment of the present invention;

[0067]FIG. 2 is a block diagram showing the functional arrangement of an image encoding apparatus according to the second embodiment of the present invention;

[0068]FIG. 3 shows the structure of a code sequence;

[0069]FIGS. 4A to 4C are views showing a two-dimensional discrete wavelet transformation process for an image to be encoded;

[0070]FIG. 5 shows an example of subbands obtained when one-dimensional wavelet transformation is repeated twice;

[0071]FIG. 6 is a flow chart showing a process for encoding subband S;

[0072]FIG. 7 is a view for explaining an example of tiles divided by a tile division unit 201;

[0073]FIG. 8 shows the structure of tile encoded data when image region separation information Z output from an image region discrimination unit 202 is zero in the second embodiment of the present invention;

[0074]FIG. 9 is a block diagram showing the functional arrangement of an image encoding apparatus according to the third embodiment of the present invention;

[0075]FIG. 10 is a block diagram showing the basic arrangement of an image encoding apparatus in the first to sixth embodiments of the present invention;

[0076]FIG. 11 is a block diagram showing the functional arrangement of an image encoding apparatus according to the fourth embodiment of the present invention;

[0077]FIG. 12 shows an example of a document and high-resolution region information;

[0078]FIG. 13 shows an example of a resolution flag F(x, y) when the high-resolution region information is designated, as shown in FIG. 12;

[0079]FIG. 14 is a block diagram showing the functional arrangement of an image encoding apparatus according to the fifth embodiment of the present invention; and

[0080]FIG. 15 is a block diagram showing the functional arrangement of an image encoding apparatus according to the sixth embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0081] Preferred embodiments of the present invention will now be described in detail in accordance with the accompanying drawings.

[0082] [First Embodiment]

[0083]FIG. 1 shows the functional arrangement of an image encoding apparatus of this embodiment. Referring to FIG. 1, reference numeral 101 denotes an image input unit; 102, a discrete wavelet transformer; 103, a coefficient quantizer; 104, a coefficient correction unit; 105, a high-resolution region information input unit; 106, a mask generator; 107, a bit plane encoder; 108, a code sequence forming unit; and 109, a code output unit.

[0084]FIG. 10 shows the basic arrangement of the image encoding apparatus of this embodiment.

[0085] Reference numeral 1001 denotes a CPU which controls the entire image encoding apparatus of this embodiment using programs and data stored in a RAM 1002 and ROM 1003, and executes various encoding processes (to be described later). Reference numeral 1002 denotes a RAM which has an area for temporarily storing programs and data loaded from an external storage device 1004 and storage medium drive 1010, and also has a work area used when the CPU 1001 executes various processes. Reference numeral 1003 denotes a ROM which stores programs, data, and the like used to, e.g., control the entire image encoding apparatus of this embodiment. Reference numeral 1004 denotes an external storage device such as a hard disk or the like, which saves programs, data, and the like loaded from the storage medium drive 1009. Reference numerals 1005 and 1006 respectively denote a keyboard and mouse, which can input various instructions to the image encoding apparatus of this embodiment. Reference numeral 1007 denotes a display device such as a CRT, liquid crystal display, or the like, which can display various messages, text information, image information, and the like. Reference numeral 1008 denotes an image input device which includes an image sensing apparatus such as a scanner, digital camera, or the like, an image sensing device such as a CCD or the like, and various image adjustment circuits such as gamma correction, shading correction, and the like. Reference numeral 1009 denotes a storage medium drive which loads programs, data, and the like from a storage medium such as a CD-ROM, DVD, or the like, and outputs them to the RAM 1002, external storage device 1004, and the like. Reference numeral 1010 denotes a bus which interconnects the aforementioned units.

[0086] Note that programs of encoding processes to be described later are loaded from a storage medium such as a CD-ROM, DVD, or the like via the drive 1009, and are executed. However, the present invention is not limited to this, and the programs may be stored in the ROM 1003.

[0087] As described above, the image encoding apparatus of this embodiment comprises the basic arrangement shown in FIG. 10. A program having the functional arrangement shown in FIG. 1 may be loaded from the storage medium drive 1009, external storage device 1004, or the like, and may be executed by the CPU 1001 to implement an image encoding apparatus with the arrangement shown in FIG. 1.

[0088] In the description of this embodiment, assume that monochrome image data in which the luminance value of one pixel is expressed by 8 bits is to be encoded. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data.

[0089] The functions and operations of the respective units of the image encoding apparatus with the functional arrangement shown in FIG. 1 will be described below.

[0090] Image data P(x, y) to be encoded by the encoding process of the image encoding apparatus of this embodiment is input from the image input unit 101 in the raster scan order. The image input unit 101 serves as the image input device 1008, and has an image sensing function such as a scanner, digital camera, or the like. The image input unit 101 also includes an image sensing device such as a CCD or the like, and various image adjustment circuit functions such as gamma correction, shading correction, and the like.

[0091] The discrete wavelet transformer 102 executes two-dimensional discrete wavelet transformation of the image data P(x, y) input from the image input unit 101 while storing the image data in the RAM 1002 as needed. The transformer 102 decomposes the image data P(x, y) into seven subbands LL, LH1, HL1, HH1, LH2, HL2, and HH2, and outputs coefficients of respective seven subbands to an area different from that which stores the image data P(x, y) in the RAM 1002. In the following description, C(S, x, y) represents the coefficient of each subband. S represents a subband, i.e., one of LL, LH1, HL1, HH1, LH2, HL2, and HH2. Also, x and y indicate the horizontal and vertical coefficient positions when the coefficient position of the upper left corner in each subband is (0, 0). The two-dimensional discrete wavelet transformation is implemented by applying one-dimensional transformation (filter process) in the horizontal and vertical directions of the image to be transformed.

[0092]FIGS. 4A to 4C show the two-dimensional discrete wavelet transformation processes for the image to be encoded. one-dimensional discrete wavelet transformation is applied to the image to be encoded (FIG. 4A) in the vertical direction to decompose it into low-frequency subband L and high-frequency subband H (FIG. 4B). Furthermore, one-dimensional discrete wavelet transformation is applied to each of these subbands in the horizontal direction to decompose them into four subbands LL, HL, LH, and HH (FIG. 4C). In the image encoding apparatus of this embodiment, one-dimensional discrete wavelet transformation for N one-dimensional signals x(n) (n=0 to N−1) is described by:

h(n)=x(2n+1)−(x(2n)+x(2n+2))/2  (1)

l(n)=x(2n)+(h(n−1)+h(n)+2)/4  (2)

[0093] where h(n) is a coefficient of the high-frequency subband, and l(n) is that of the low-frequency subband. Note that x(n) (n<0 and n≧N) at two ends of the one-dimensional signals x(n) required to calculate the above equations are calculated in advance from the values of the one-dimensional signals x(n) (0≦n<N) by a known method (a detailed description thereof will be omitted). By repetitively applying two-dimensional discrete wavelet transformation to subband LL obtained by the aforementioned two-dimensional discrete wavelet transformation, it can be decomposed into seven subbands LL, LH1, HL1, HH1, LH2, HL2, and HH2, as shown in FIG. 5. Note that LL in FIG. 5 is not equal to that in FIG. 4C, since it is obtained by re-decomposing LL in FIG. 4C.

[0094] The coefficient quantizer 103 quantizes coefficients C(S, x, y) of respective subbands generated by the discrete wavelet transformer 102 using quantization steps delta(S) which are determined for respective subbands. If Q(S, x, y) represents the quantized coefficient value, the quantization process executed by the coefficient quantizer 103 is described by:

Q(S,x,y)=sign{C(S,x,y)}×floor{|C(S,x,y)|/delta(S)}

[0095] where sign{I} is a function which indicates the positive/negative sign of integer I, and returns 1 if I is positive or −1 if I is negative. Also, floor{R} represents a maximum integral value that does not exceed real number R.

[0096] On the other hand, the high-resolution region information input unit 105 inputs region designation information H(x, y) that designates a region (e.g., a text region in an image) that requires a high resolution in synchronism with the image data input from the image input unit 101. This input may be made by the operator of the image encoding apparatus of this embodiment or as a result of the image process by the image encoding apparatus of this embodiment.

[0097] In the former case, an image to be encoded is displayed on the display device 1007, and the operator selects a region that requires a high resolution using the keyboard 1005 and mouse 1006 with reference to the image displayed on the display device 1007. Upon this selection, a GUI or the like may be used.

[0098] In the latter case, if a region that requires a high resolution is a text region in an image, this text region may be estimated using an image process such as an edge process. Also, in the latter case, an image must be input from the image input unit 101.

[0099] Note that H(x, y) assumes a value “0” or “1”. If H(x, y)=1, it indicates a region that requires a high resolution; if H(x, y)=0, it indicates a region that does not require a high resolution. Also, H(0, 0) indicates region designation information for a pixel at the upper left corner of an image.

[0100] On the basis of region designation information H(x, y) input (designated) from the high-resolution region information input unit 105, the mask generator 106 generates mask information M(S, x, y) (S is one of HL2, LH2, and HH2) indicating whether or not respective coefficients of HL2, LH2, and HH2 subbands are generated with reference to pixels of a high-resolution region. When at least one pixel in a high-resolution region, i.e., P(x, y) corresponding to H(x, y)=1, is used during a process of calculating C(S, x, y) from image data P(x, y) using equations (1) and (2), mask information M(S, x, y) is 1; otherwise, it is set to be 0. Note that mask information M(S, 0, 0) indicates that corresponding to a coefficient at the upper left corner of those contained in each subband S.

[0101] The coefficient value correction unit 104 corrects a coefficient Q(S, x, y) of each subband quantized by the coefficient quantizer 103 with reference to M(S, x, y) generated by the mask generator 106 to obtain a corrected quantized value Q′ (S, x, y) if subband S is one of HL2, LH2, and HH2. If subband S is other than HL2, LH2, and HH2, a corrected quantized value Q′(S, x, y)=Q(S, x, y) If subband S is one of HL2, LH2, and HH2, Q′ (S, x, y) is given by: ${Q^{\prime}\left( {S,x,y} \right)} = \left\{ \begin{matrix} {{Q\left( {S,x,y} \right)}\quad \left( {{{if}\quad {M\left( {S,x,y} \right)}} = 1} \right)} \\ {0\quad \left( {{{if}\quad {M\left( {S,x,y} \right)}} = 0} \right)} \end{matrix} \right.$

[0102] That is, if a coefficient is associated with a pixel within a high-resolution region, Q(S, x, y) is directly output as the corrected quantized value; if a coefficient is not associated with pixel within a high-resolution region, Q(S, x, y) is replaced by zero.

[0103] The bit plane encoder 107 encodes the corrected quantized values Q′(S, x, y) generated by the coefficient value correction unit 104 to generate a code sequence. A method of segmenting coefficients of respective subbands into blocks and individually encoding them to allow easy random access is known. However, in this embodiment, coefficients are encoded for respective subbands for the sake of simplicity. The corrected quantized values Q′(S, x, y) (to be simply referred to as coefficient values hereinafter) of respective subbands are encoded by expressing the absolute values of the coefficient values Q′(S, x, y) in each subband by natural binary values, and executing binary arithmetic coding from the upper to lower digits while giving priority to the bit plane direction. In the following description, Qn(S, x, y) represents a bit at the n-th digit position from the LSB when the corrected quantized value Q′(S, x, y) of each subband is expressed by a natural binary number. Note that variable n indicating the digit of a binary value is called a bit plane number, and bit plane number n has the LSB at the 0th digit position.

[0104]FIG. 6 is a flow chart showing the process for encoding subband S by the bit plane encoder 107.

[0105] Step S601 obtains a maximum value Mabs(S) of the absolute values of the coefficients in subband S, step S602 obtains the number N_(BP)(S) of effective digits required to express the maximum value Mabs(S), step S603 substitutes the number of effective digits in variable n, step S604 calculates (n−1) and substitutes it in n, step S605 encodes a bit plane of the n-th digit, and step S606 checks if n=0.

[0106] The flow of the encoding process of subband S by the bit plane encoder 107 will be explained below with reference to FIG. 6. In step S601, the absolute values of the coefficients in subband S to be encoded are checked to obtain a maximum value Mabs(S). In step S602, the number N_(BP)(S) of effective digits required to express Mabs(S) by a binary number is calculated by:

N _(BP)(S)=ceil{log2(Mabs(S)+1)}

[0107] where ceil{R} indicates a minimum integer equal to or larger than real number R. In step S603, the number NBP(S) of effective digits is substituted in bit plane number n. In step S604, 1 is subtracted from bit plane number n. In step S605, bit plane n is encoded using a binary arithmetic code. In this embodiment, QM-Coder is used as the arithmetic code. Since a sequence for encoding a binary symbol generated in a given context using this QM-Coder, or the initialization and termination sequences for the arithmetic encoding process have been explained in detail in ITU-T Recommendation T.81|ISO/IEC10918-1 as the international standards of still images, a detailed description thereof will be omitted. For the sake of simplicity, in this embodiment, respective bits undergo arithmetic encoding by a single context. An arithmetic encoder (not shown) in the bit plane encoder 107 is initialized at the beginning of encoding of each bit plane, and undergoes a termination process at the end of the process. Immediately after ‘1’ to be encoded first of each coefficient, the sign of that coefficient is expressed by 0 or 1, and is encoded by the arithmetic encoder. If the sign is positive, a symbol ‘0’ is encoded; if it is negative, a symbol ‘1’ is encoded. For example, if a coefficient is -5 and the number N_(BP)(S) of effective digits of subband S to which this coefficient belongs is 6, the absolute value of that coefficient is expressed by a binary value 000101, and is encoded from the upper to lower digits upon encoding respective bit planes. Upon encoding the second bit plane (in this case, the fourth digit from the MSB side), first ‘1’ is encoded, and immediately after this encoding, the sign is converted into an arithmetic code ‘1’.

[0108] In step S606, bit plane number n is compared with 0. If n=0, i.e., if the LSB plane has been encoded in step S605, the encoding process of the subband ends; otherwise, the flow returns to step S604.

[0109] With the above process, all coefficients of subband S are encoded to generate code sequences CS(S, n) corresponding to respective bit planes n. The generated code sequences are sent to the code sequence forming unit 108. The sent coefficient sequences are temporarily stored in the RAM 1002.

[0110] If the bit plane encoder 107 has encoded the coefficients of all subbands and all code sequences are stored in the RAM 1002, the code sequence forming unit 108 reads out the code sequences stored in the RAM 1002 in a predetermined order, inserts additional information required upon decoding to form a final code sequence as the output of the image encoding apparatus of this embodiment, and outputs that code sequence to the code output unit 109.

[0111] The final code sequence generated by the code sequence forming unit 108 consists of a header and encoded data hierarchized in three levels 0, 1, and 2. The encoded data of level 0 consists of code sequences CS(LL, N_(BP)(LL)−1) to CS(LL, 0) obtained by encoding the coefficients of LL subband. The encoded data of level 1 consists of code sequences CS(LH1, N_(BP)(LH1)−1) to CS(LH1, 0), CS(HL1, N_(BP)(HL1)−1) to CS(HL1, 0), and CS(HH1, N_(BP)(HH1)−1) to CS(HH1, 0) obtained by encoding the coefficients of LH1, HL1, and HH1 subbands. The encoded data of level 2 consists of code sequences CS(LH2, N_(BP)(LH2)−1) to CS(LH2, 0), CS(HL2, NBP(HL2)−1) to CS(HL2, 0), and CS(HH2, N_(BP)(HH2)−1) to CS(HH2, 0) obtained by encoding the coefficients of LH2, HL2, and HH2 subbands.

[0112]FIG. 3 shows the structure of the code sequence generated by the code sequence forming unit 108.

[0113] The code output unit 109 outputs the code sequence generated by the code sequence forming unit 108 outside the apparatus. The code output unit 109 includes, e.g., a function of a storage device such as the storage medium drive 1010, external storage device 1004, or the like, and a function of a network interface or the like.

[0114] As described above, transform coefficients required to obtain a high resolution are held for a region for which a high resolution is required, and other transform coefficients are replaced by zero upon encoding. Hence, image data that includes regions having different required resolutions can efficiently undergo lossy encoding.

[0115] In this embodiment, the coefficient value correction unit 104 corrects quantized values Q(S, x, y) from the coefficient quantizer 103. However, the present invention is not limited to such specific arrangement. For example, coefficients from the discrete wavelet transformer 102 may be directly corrected.

[0116] [Second Embodiment]

[0117]FIG. 2 shows the functional arrangement of an image encoding apparatus according to this embodiment. The same reference numerals in FIG. 2 denote the same parts as those in FIG. 1, and a description thereof will be omitted. Also, the basic arrangement of the image encoding apparatus of this embodiment is the same as that (FIG. 10) in the first embodiment. Furthermore, a text region in an image is used as a region that requires a high resolution in this embodiment, but the present invention is not limited to such specific region.

[0118] Referring to FIG. 2, reference numeral 201 denotes a tile division unit; 202, an image region discrimination unit; and 203, a coefficient value correction unit.

[0119] In the description of this embodiment, assume that monochrome image data in which the luminance value of one pixel is expressed by 8 bits is to be encoded, as in the first embodiment. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data.

[0120] The functions and operations of the respective units of the image encoding apparatus with the functional arrangement shown in FIG. 2 will be described below.

[0121] Image data P(x, y) is input from the image input unit 101 in the raster scan order. The image input unit 101 serves as the image input device 1008, and has an image sensing function such as a scanner, digital camera, or the like. The image input unit 101 also includes an image sensing device such as a CCD or the like, and various image adjustment circuit functions such as gamma correction, shading correction, and the like.

[0122] The tile division unit 201 stores the image data P(x, y) input from the image input unit 101 in the raster scan order in the RAM 1002, and divides it into tiles each having a predetermined width TW and height TH. FIG. 7 shows an example of tiles divided by the tile division unit 201. As shown in FIG. 7, T0 represents a tile at the upper left corner position, numbers T1, T2, . . . , Tn are assigned to tiles in the raster scan order, and Ti(x, y) (i=0 to n) represents the pixel value in each tile. Note that Ti(0, 0) indicates the value of a pixel at the upper left corner position of the i-th tile.

[0123] After that, tiles T0 to Tn formed by the tile division unit 201 are encoded in turn.

[0124] The discrete wavelet transformer 102 executes two-dimensional discrete wavelet transformation of the tile data Ti(x, y) formed by the tile division unit 201 while appropriately storing them in the RAM 1002. The transformer 102 decomposes each tile data Ti(x, y) into seven subbands LL, LH1, HL1, HH1, LH2, HL2, and HH2, and outputs coefficients of respective seven subbands to an area different from that which stores the tile data Ti(x, y) in the RAM 1002. The subband decomposition method of tile data Ti(x, y) by the discrete wavelet transformer 102 is the same as that of pixel data P(x, y) in the first embodiment.

[0125] The coefficient quantizer 103 quantizes coefficients C(S, x, y) of respective subbands generated by the discrete wavelet transformer 102 as in the first embodiment.

[0126] The image region discrimination unit 202 acquires tile data Ti(x, y) divided by the tile division unit 201 at the same timing as the discrete wavelet transformer 102, checks if each tile contains text information, and outputs checking result (image region separation information) Z. If it is determined that the tile contains text information, image region separation information Z is 1; otherwise, Z is 0. In this method, a practical image region determination method is not particularly limited. For example, each tile data may be displayed on the display device 1007, and the operator of the image encoding apparatus of this embodiment may check the presence/absence of text information using the keyboard 1005 or mouse 1006 and may input the checking result. In such case, the image region discrimination unit 202 executes a process for reflecting the input result in the image region separation information Z. In addition, each tile data Ti may undergo a differential process, it may be checked based on edge information as a result of the differential process if the tile data Ti contains text information, and the checking result may be output as image region separation information Z. In this case, the image region discrimination unit 202 executes an edge information derivation process such as the differential process, and the aforementioned determination process using the edge information, and then executes a process for reflecting that result in image region separation information Z.

[0127] The coefficient value correction unit 203 corrects a coefficient Q(S, x, y) of each subband quantized by the coefficient quantizer 103 with reference to the image region separation information Z generated by the image region discrimination unit 202 to obtain a corrected quantized value Q′ (S, x, y) if subband S is one of HL2, LH2, and HH2. If subband S is other than HL2, LH2, and HH2, a corrected quantized value Q′(S, x, y)=Q(S, x, y). If subband S is one of HL2, LH2, and HH2, Q′(S, x, y) is given by: ${Q^{\prime}\left( {S,x,y} \right)} = \left\{ \begin{matrix} {{Q\left( {S,x,y} \right)}\quad \left( {{{if}\quad Z} = 1} \right)} \\ {0\quad \left( {{{if}\quad Z} = 0} \right)} \end{matrix} \right.$

[0128] That is, if it is determined that each tile contains text information, Q(S, x, y) is directly output as the corrected quantized value; otherwise, all coefficients of HL2, LH2, and HH2 subbands of that tile are replaced by zero.

[0129] The bit plane encoder 107 encodes the corrected quantized values Q′(S, x, y) generated by the coefficient value correction unit 104 to generate a code sequence. The encoding method of the corrected quantized values Q′(S, x, y) of respective subbands is as has been described in the first embodiment. If the checking result Z output from the image region discrimination unit 202 is zero, since the coefficient value correction unit 203 replaces all corrected quantized values of HL2, LH2, and HH2 subbands by zero, all the numbers N_(BP)(HL2), N_(BP)(LH2), and N_(BP)(HH2) of effective bits of respective subbands become zero, and no subband coefficient encoded data is generated.

[0130] If the bit plane encoder 107 has encoded the coefficients of all subbands of one tile and all code sequences are stored in the RAM 1002, the code sequence forming unit 108 reads out the code sequences stored in the RAM 1002 in a predetermined order, inserts additional information required upon decoding that tile to form encoded data of the tile, and outputs that code sequence to the code output unit 109. If the tile is the first one (tile number T0) of image data, the code sequence forming unit 108 further inserts additional information required to decode image data such as the numbers of samples in the horizontal and vertical directions of an image, the sizes TW and TH of each tile, and the like, at the head of the code sequence.

[0131] The encoded data of each tile generated by the code sequence forming unit 108 consists of a header and encoded data hierarchized in three levels 0, 1, and 2. The encoded data of level 0 consists of code sequences CS(LL, N_(BP)(LL)−1) to CS(LL, 0) obtained by encoding the coefficients of LL subband. The encoded data of level 1 consists of code sequences CS(LH1, N_(BP)(LH1)−1) to CS(LH1, 0), CS(HL1, NBP(HL1)−1) to CS(HL1, 0), and CS(HH1, NBP (HH1)−1) to CS(HH1, 0) obtained by encoding the coefficients of LH1, HL1, and HH1 subbands. The encoded data of level 2 consists of code sequences CS(LH2, NBP (LH2)−1) to CS(LH2, 0), CS(HL2, NBP(HL2)−1) to CS(HL2, 0), and CS(HH2, NBP (HH2)−1) to CS(HH2, 0) obtained by encoding the coefficients of LH2, HL2, and HH2 subbands. However, if the image region separation information Z output from the image region discrimination unit 202 is 0, encoded data of level 2 includes only information indicating the numbers of effective bits of respective subbands. FIG. 8 shows the structure of tile encoded data in this case.

[0132] The structure of tile encoded data when the checking result Z output from the image region discrimination unit 202 is 1 is the same as that of the code sequence of the first embodiment shown in FIG. 3.

[0133] The code output unit 109 outputs the tile encoded data generated by the code sequence forming unit 108 outside the apparatus. The code output unit 109 includes, e.g., a function of a storage device such as the storage medium drive 1010, external storage device 1004, or the like, and a function of a network interface or the like.

[0134] With the above process, it is checked for each tile if high-resolution data is necessary. For a tile that does not require high-resolution data, transform coefficients required to obtain a high resolution are replaced by zero upon encoding. Hence, image data that includes regions having different required resolutions can efficiently undergo lossy encoding.

[0135] [Third Embodiment]

[0136]FIG. 9 shows the functional arrangement of an image encoding apparatus according to this embodiment. The same reference numerals in FIG. 9 denote the same parts as those in FIGS. 1 and 2, and a description thereof will be omitted. Also, the basic arrangement of the image encoding apparatus of this embodiment is the same as that (FIG. 10) in the first embodiment.

[0137] Referring to FIG. 9, reference numeral 901 denotes an adaptive discrete wavelet transformer. The adaptive discrete wavelet transformer 901 has a function of selecting a filter to be used in subband decomposition in accordance with image region separation information Z.

[0138] In the description of this embodiment, assume that monochrome image data in which the luminance value of one pixel is expressed by 8 bits is to be encoded, as in the first and second embodiments. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data.

[0139] Since the image encoding apparatus of this embodiment is substantially the same as the second embodiment except that the discrete wavelet transformer 102 is replaced by the adaptive discrete wavelet transformer 901, and the connection is changed to input the image region separation information Z of the image region discrimination unit 202 to the adaptive discrete wavelet transformer 901, only the operation of the changed adaptive discrete wavelet transformer 901 will be explained.

[0140] The adaptive discrete wavelet transformer 901 executes two-dimensional discrete wavelet transformation of the tile data Ti(x, y) formed by the tile division unit 201 while storing them in the RAM 1002 as needed. The transformer 102 decomposes each tile data Ti(x, y) into seven subbands LL, LH1, HL1, HH1, LH2, HL2, and HH2, and outputs coefficients of respective seven subbands to an area different from that which stores the tile data Ti(x, y) in the RAM 1002. The subband decomposition method of tile data Ti(x, y) by the discrete wavelet transformer 901 is substantially the same as that of pixel data P(x, y) in the first embodiment, except that a filter to be used is switched in accordance with the image region separation information Z from the image region discrimination unit 202. If the image region separation information Z from the image region discrimination unit 202 is zero, i.e., if it is determined that a given tile does not contain any text region, a filter given by equations (1) and (2) is used as in discrete wavelet transformation of the first and second embodiments. On the other hand, if the checking result Z is 1, i.e., if it is determined that a given tile contains a text region, the following equations are used in place of equations (1) and (2):

h(n)=x(2n)−x(2n+1)  (3)

l(n)=floor{x(2n)+x(2n+1)/2}  (4)

[0141] where floor{R} represents a maximum integral value that does not exceed real number R. Hence, since this embodiment uses two filters, these filters must be stored in the external storage device 1004 or RAM 1002.

[0142] Coefficients C(S, x, y) of respective subbands generated by the adaptive discrete wavelet transformer 901 are encoded in the sequence that has been explained in the second embodiment, and encoded data is output from the code output unit 109. In this embodiment, a header inserted in each tile encoded data by the code sequence forming unit 108 contains the image region separation information Z from the image region discrimination unit 202 to inform the decoding side of the filter used.

[0143] With the above process, it is checked for each tile if a text region is contained. The filter to be used in discrete wavelet transformation is selected in accordance with the checking result, and for a tile that does not contain any text region, transform coefficients required to obtain a high resolution are replaced by zero upon encoding. Hence, image data that includes regions having different required resolutions can efficiently undergo lossy encoding.

[0144] (Modification)

[0145] The present invention is not limited to the aforementioned embodiments. For example, in the first to third embodiments described above, encoding using discrete wavelet transformation given by equations (1) and (2) has been exemplified. However, discrete wavelet transformation is not limited to that used in the above embodiments, and the types of filters and adaptive method may be changed. For example, a filter having a large number of taps, e.g., a 9/7 filter may be used instead, and two-dimensional discrete wavelet transformation may be repetitively applied to subbands other than the low-frequency subband. The bit plane encoding method using QM-Coder has been exemplified as the coefficient encoding method. However, the present invention is not limited to the above embodiments. For example, arithmetic coding methods such as MQ-Coder and the like other than QM-Coder may be applied, and other binary coding methods such as MELCODE and the like may be applied. Also, a bit plane may be categorized into a plurality of sub-bit planes in accordance with the state of coefficients near the coefficient of interest, and may be encoded in a plurality of passes. Furthermore, Golomb coding may be applied to directly execute entropy-coding of multi-valued coefficients without decomposing them into binary data.

[0146] In the above embodiments, bit plane encoding for respective subbands has been explained for the sake of simplicity. However, each subband may be further segmented into small blocks, and bit plane encoding may be applied to each small block, so as to allow easy random access.

[0147] Upon forming the code sequence, the receiving side can reconstruct an image while gradually increasing the resolution. However, the present invention is not limited to this. For example, a code sequence may be formed by arranging coefficients in descending order of values so as to gradually improve the image quality.

[0148] With the above description, upon encoding image data that contains regions which require different resolution levels, the present invention can achieve efficient image encoding.

[0149] [Fourth Embodiment]

[0150]FIG. 11 shows the functional arrangement of an image encoding apparatus according to this embodiment. Referring to FIG. 11, reference numeral 5101 denotes a high-resolution region information input unit; 5102, a high-resolution scan region determination unit; 5103, a high-resolution image input unit; 5104, a low-resolution image input unit; 5105, a discrete wavelet transformer; 5106, a coefficient multiplexer; 5107, a discrete wavelet transformer; 5108, a bit plane encoder; 5109, a code sequence forming unit; and 5110, a code output unit. Since the basic arrangement of the image encoding apparatus of this embodiment is the same as that of the first embodiment shown in FIG. 10, a description thereof will be omitted.

[0151] In the description of this embodiment, assume that a monochrome document is scanned as image data in which the luminance value of each pixel is expressed by 8 bits, and that image data is to be encoded. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data.

[0152] The functions and operations of the respective units of this embodiment will be described below with reference to FIGS. 11 and 10. In this embodiment, a monochrome document to be encoded is scanned at a predetermined resolution, and the scanned image data is encoded. In this case, only a portion of the document can be scanned at a resolution twice the predetermined resolution in both the horizontal and vertical directions. The predetermined resolution will be referred to as a low resolution, and the resolution twice the predetermined resolution in both the horizontal and vertical directions will be referred to as a high resolution hereinafter. Assume that the size of a monochrome document is fixed, and X and Y represent the image size obtained when the entire document is scanned at the high resolution. Also, both X and Y are multiples of 4.

[0153] High-resolution region information that designates a portion of the document to be scanned at the high resolution is input from the high-resolution region information input unit 5101. In this embodiment, a region to be scanned at the high resolution is a rectangular region. The high-resolution region information is specified by an upper left corner pixel position (Ulx, Uly), and lower right corner pixel position (LRx, LRy) with reference to the image size when the document is scanned at the high resolution. FIG. 12 shows an example of a document and high-resolution region information.

[0154] The high-resolution scan region determination unit 5102 generates resolution flags F(x, y) that designate pixel positions to be scanned at the high resolution in practice on the basis of the upper left and lower right corner pixel positions of the high-resolution region input from the high-resolution region information input unit 5101. The generated resolution flags F(x, y) are temporarily stored in the RAM 1002. For a pixel position to be scanned at the high resolution in practice, the resolution flag F(x, y) is set to be 1; otherwise, the flag is set to be zero. More specifically, ${F\left( {x,y} \right)} = \left\{ \begin{matrix} {{1\quad {floor}\quad \left\{ {{Ulx}/2} \right\} \times 2} \leq x < {\left( {{{floor}\left\{ {{LRx}/2} \right\}} + 1} \right) \times 2\quad {and}}} \\ {{{{floor}\quad \left\{ {{Uly}/2} \right\} \times 2} \leq y < {\left( {{{floor}\left\{ {{LRy}/2} \right\}} + 1} \right) \times 2}}\quad} \\ \quad \\ {0\quad {otherwise}} \end{matrix} \right.$

[0155]FIG. 13 shows an example of the resolution flag F(x, y) when the high-resolution region information is designated, as shown in FIG. 12.

[0156] After the region to be scanned at the high resolution is determined by the high-resolution scan region determination unit 5102, the high- and low-resolution image input units 5103 and 5104 respectively scan images of high- and low-resolution portions on the basis of the resolution flags F(x, y). In practice, the high- and low-resolution image input units 5103 and 5104 receive an image of an identical document, and respectively scan high- and low-resolution portions.

[0157] The high-resolution image input unit 5103 scans pixel data from the monochrome document only for a portion where the resolution flags F(x, y)=1, and forms high-resolution image data Ph(x, y) in the RAM 1002. The unit 5103 does not actually scan a portion where the resolution flags F(x, y)=0 while setting Ph(x, y)=0.

[0158] The discrete wavelet transformer 5105 executes two-dimensional discrete wavelet transformation of respective pixel data Ph(x, y) of high-resolution image data input from the high-resolution image input unit 5103 while storing them in the RAM 1002 as needed, thereby decomposing the image data into four subbands LL, LH, HL, and HH. The transformer 5105 outputs coefficients of the respective subbands to an area which is different from the area where the image data Ph(x, y) is stored in the RAM 1002. In the following description, C(S, x, y) represents the coefficient of each subband. S represents a subband, i.e., one of LL, LH, HL, and HH. Also, x and y indicate the horizontal and vertical coefficient positions when the coefficient position of the upper left corner in each subband is (0, 0).

[0159] The two-dimensional discrete wavelet transformation is implemented by applying one-dimensional transformation (filter process) in the horizontal and vertical directions. Since the two-dimensional discrete wavelet transformation process is the same as that described using FIGS. 4A to 4C, a description thereof will be omitted. In the image encoding apparatus of this embodiment, one-dimensional discrete wavelet transformation for N one-dimensional signals x(n) (n=0 to N−1) is described by:

h(n)=x(2n)−x(2n+1)  (5)

l(n)=floor{(x(2n)+x(2n+1))/2}  (6)

[0160] where h(n) is a coefficient of the high-frequency subband, and l(n) is that of the low-frequency subband. Also, floor{R} represents a maximum integral value that does not exceed real number R.

[0161] On the other hand, the low-resolution image input unit 5104 scans image data at the low resolution for pixels with F(x, y)=0 with reference to the resolution flags generated by the high-resolution scan region determination unit 5102, and forms a low-resolution image Pl(lx, ly) in the RAM 1002 (an area different from the area where the high-resolution image data Ph (x, y) is stored). Note that lx ranges from 0 to (X/2−1), and ly ranges from 0 to (Y/2−1). Four flags F(lx×2, ly×2), F(lx×2+1, ly×2), F(lx×2, ly×2+1), and F(lx×2+1, ly×2+1) are assigned to one pixel Pl(lx, ly) of the low-resolution image. Since the coordinate values of four corners of the high-resolution region are even numbers and, hence, these four flags assume the same value, F(lx×2, ly×2) is used as an index for determining if a scan is required. That is, for lx and ly corresponding to the resolution flag F(lx×2, ly×2), an actual scan operation is skipped while setting Pl(lx, ly)=0.

[0162] Upon completion of the low-resolution image input of the low-resolution image input unit 5104, and subband decomposition of the high-resolution image in the discrete wavelet transformer 5105, the coefficient multiplexer 5106 multiplexes low-frequency subband C(LL, x, y) generated by the discrete wavelet transformer 5105 and the low-resolution image Pl(lx, ly) with reference to the resolution flags F(x, y) generated by the high-resolution scan region determination unit 5102. Since low-frequency subband C(LL, x, y) has the same size as the low-resolution image Pl(lx, ly) (the horizontal and vertical sizes are X/2 and Y/2), the multiplexing process in the coefficient multiplexer 5106 will be explained while replacing variables x and y that represent coordinate positions in the subband by lx and ly.

[0163] The coefficient multiplexer 5106 checks the resolution flags F(lx×2, ly×2) of all coefficients of C(LL, lx, ly) in the raster scan order, and replaces C(LL, lx, ly) by Pl(lx, ly) if F(lx×2, ly×2)=0. When this replacement process is done for all the coefficients of C(LL, lx, ly) in this way, coefficients corresponding to the low-resolution image portion in C(LL, lx, ly) can be replaced by the low-resolution image Pl(lx, ly).

[0164] The discrete wavelet transformer 5107 decomposes new C(LL, lx, ly) obtained by multiplexing C(LL, lx, ly) and Pl(lx, ly) by the coefficient multiplexer 5106 into four subbands by the same process as in the discrete wavelet transformer 5105. FIG. 5 shows the state wherein the multiplexed LL subband is further decomposed into four subbands by the discrete wavelet transformer 5107. In FIG. 5, LH, LH, and HH subbands generated by the discrete wavelet transformer 5105 are indicated by LH2, HL2, and HH2, and those generated by the discrete wavelet transformer 5107 are indicated by LH1, HL1, and HH1 to distinguish them from the former subbands. Note that LL in FIG. 5 is not equal to that in FIG. 4C, since it is obtained by re-decomposing LL subband in FIG. 4C multiplexed with the low-resolution image.

[0165] The bit plane encoder 5108 encodes coefficient values C(S, x, y) of seven subbands LL, LH1, HL1, HH1, LH2, HL2, and HH2 generated via the discrete wavelet transformer 5105, coefficient multiplexer 5106, and discrete wavelet transformer 5107, thus generating code sequences. A method of segmenting coefficients of respective subbands into blocks and individually encoding them to allow easy random access is known. However, in this embodiment, coefficients are encoded for respective subbands for the sake of simplicity. The coefficient values C(S, x, y) of respective subbands are encoded by expressing the absolute values of the coefficient values C(S, x, y) in each subband by natural binary values, and executing binary arithmetic coding from the upper to lower digits while giving priority to the bit plane direction. In the following description, Cn(S, x, y) represents a bit at the n-th digit position from the LSB when the coefficient value C(S, x, y) of each subband is expressed by a natural binary number. Note that variable n indicating the digit of a binary value is called a bit plane number, and bit plane number n has the LSB at the 0-th digit position.

[0166] Since the flow of the encoding process of subband S by the bit plane encoder 5108 is the same as that described using the flow chart of FIG. 6, a description thereof will be omitted. Note that an arithmetic encoder (not shown) in the bit plane encoder 5108 is initialized at the beginning of encoding of each bit plane, and undergoes a termination process at the end of the process. The generated code sequences are sent to the code sequence forming unit 5109, and are temporarily stored in the RAM 1002.

[0167] If the bit plane encoder 5108 has encoded the coefficients of all subbands and all code sequences are stored in the RAM 1002, the code sequence forming unit 5109 reads out the code sequences stored in the RAM 1002 in a predetermined order, inserts required additional to form a final code sequence as the output of the encoding apparatus of this embodiment, and outputs that code sequence to the code output unit 5110.

[0168] The final code sequence generated by the code sequence forming unit 5109 consists of a header and encoded data hierarchized in three levels 0, 1, and 2. The encoded data of level 0 consists of code sequences CS(LL, N_(BP)(LL)−1) to CS(LL, 0) obtained by encoding the coefficients of LL subband. The encoded data of level 1 consists of code sequences CS(LH1, N_(BP)(LH1)−1) to CS(LH1, 0), CS(HL1, NBP(HL1)−1) to CS(HL1, 0), and CS(HH1, NBP(HH1)−1) to CS(HH1, 0) obtained by encoding the coefficients of LH1, HL1, and HH1 subbands. The encoded data of level 2 consists of code sequences CS(LH2, NBP(LH2)−1) to CS(LH2, 0), CS(HL2, NBP(HL2)−1) to CS(HL2, 0), and CS(HH2, NBP(HH2)−1) to CS(HH2, 0) obtained by encoding the coefficients of LH2, HL2, and HH2 subbands. The structure of the code sequence generated by the code sequence forming unit 5109 is as shown in FIG. 3.

[0169] The code output unit 5110 outputs the code sequence generated by the code sequence forming unit 5109 outside the apparatus. The code output unit 5110 includes, e.g., a function of a storage device such as the storage medium drive 1010, external storage device 1004, or the like, and a function of a network interface or the like.

[0170] As described above, image data is separately scanned as high- and low-resolution images, and the low-resolution image is multiplexed in the low-frequency subband obtained by decomposing the high-resolution image into subbands upon encoding. Hence, only a required portion can be scanned and encoded at a high resolution.

[0171] [Fifth Embodiment]

[0172]FIG. 14 shows the functional arrangement of an image encoding apparatus according to this embodiment. Note that the same reference numerals in FIG. 14 denote the same parts as in FIG. 11 used in the fourth embodiment, and a description thereof will be omitted. Also, the basic arrangement of the image encoding apparatus of this embodiment is the same as that shown in FIG. 10.

[0173] Referring to FIG. 14, reference numeral 5801 denotes a low-resolution image input unit; 5802, an image region discrimination unit; 5803, a high-resolution image input unit; and 5804, a coefficient multiplexer.

[0174] In the description of this embodiment, assume that a monochrome document is scanned as image data in which the luminance value of each pixel is expressed by 8 bits, and that image data is to be encoded, as in the fourth embodiment. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data. In this embodiment, as in the fourth embodiment, a monochrome document to be encoded is scanned at a predetermined resolution, and the scanned image data is encoded. In this case, only a portion of the document can be scanned at a resolution twice the predetermined resolution in both the horizontal and vertical directions. The predetermined resolution will be referred to as a low resolution, and the resolution twice the predetermined resolution in both the horizontal and vertical directions will be referred to as a high resolution hereinafter. Assume that the size of a monochrome document is fixed, and X and Y represent the image size obtained when the entire document is scanned at the high resolution. Also, both X and Y are multiples of 4.

[0175] The functions and operations of respective units of the image encoding apparatus according to this embodiment will be described below using FIG. 14.

[0176] The low-resolution image input unit 5801 scans the entire monochrome document to be encoded at a half resolution (e.g., scans every other pixels in both the horizontal and vertical directions) to generate Pl(lx, ly). Note that lx ranges from 0 to (X/2−1), and ly ranges from 0 to (Y/2−1).

[0177] The image region discrimination unit 5802 detects a text/line image region from the low-resolution image Pl(lx, ly) input from the low-resolution image input unit 5801, and generates resolution flags Fl(lx, ly). Each resolution flag Fl(lx, ly) indicates if each pixel of the low-resolution image Pl(lx, ly) is included in a portion determined to be a text/line image region. If Pl(lx, ly) is included in the text/line image region, Fl(lx, ly) is set to be 1; otherwise, Fl(lx, ly) is set to be 0. In this embodiment, a practical method of text/line image region discrimination in the image region discrimination unit 5802 is not particularly limited.

[0178] The high-resolution image input unit 5803 scans the monochrome document at the resolution of the original image with reference to the resolution flags Fl(lx, ly) generated by the image region discrimination unit 5802, thus generating high-resolution image data Ph (x, y) . At a position (x, y) where the resolution flag Fl(floor{x/2}, floor{y/2})=0, an actual scan operation is skipped, and Ph(x, y)=0 is set. Note that x ranges from 0 to (X−1), and y ranges from 0 to (Y−1).

[0179] The discrete wavelet transformer 5105 decomposes the pixel data Ph(x, y) of the high-resolution image data input from the high-resolution image input unit 5803 into subbands as in the fourth embodiment, thus generating coefficients C(S, x, y) (S is one of LL, LH, HL, and HH) of respective subbands.

[0180] Upon completion of subband decomposition of the high-resolution image in the discrete wavelet transformer 5105, the coefficient multiplexer 5804 multiplexes low-frequency subband C(LL, x, y) generated by the discrete wavelet transformer 5105, and the low-resolution image Pl(lx, ly) with reference to the resolution flags Fl(lx, ly) generated by the image region discrimination unit 5802. Since low-frequency subband C(LL, x, y) has the same size as the low-resolution image Pl(lx, ly), the multiplexing process in the coefficient multiplexer 5804 will be explained while replacing variables x and y that represent coordinate positions in the subband by lx and ly. The coefficient multiplexer 5804 checks the resolution flags Fl(lx, ly) of all coefficients of C(LL, lx, ly) in the raster scan order, and replaces C(LL, lx, ly) by Pl(lx, ly) if Fl(lx, ly)=0.

[0181] After that, the encoding process from the discrete wavelet transformer 5107 to the code output unit 5110 is the same as that in the fourth embodiment.

[0182] As described above, image data is separately scanned as high- and low-resolution images, and the low-resolution image is multiplexed in the low-frequency subband obtained by decomposing the high-resolution image into subbands upon encoding. Hence, only a required portion can be scanned and encoded at a high resolution. In this embodiment, since a document is temporarily scanned at a low resolution, a region that requires a high resolution can be selectively scanned.

[0183] [Sixth Embodiment]

[0184]FIG. 15 shows the functional arrangement of an image encoding apparatus according to this embodiment. Note that the same reference numerals in FIG. 15 denote the same parts as in FIG. 11 used in the fourth embodiment and in FIG. 14 used in the fifth embodiment, and a description thereof will be omitted. Also, the basic arrangement of the image encoding apparatus of this embodiment is the same as that shown in FIG. 10.

[0185] Referring to FIG. 15, reference numeral 5901 denotes a mask generator; and 5902, a coefficient shift unit.

[0186] In the description of this embodiment, assume that a monochrome document is scanned as image data in which the luminance value of each pixel is expressed by 8 bits, and that image data is to be encoded, as in the fourth and fifth embodiments. However, the present invention is not limited to such specific data, but can be applied to image data in which the luminance value is expressed by the number of bits other than 8 bits (e.g., 4 bits, 10 bits, 12 bits, or the like). Also, the present invention can be applied to color image data in which each pixel is expressed by a plurality of color components such as RGB, CMYK, or the like or by luminance and chromaticity/color difference components such as YCrCb, or the like. In such case, each component in color image data can be considered as monochrome image data. In this embodiment, as in the fourth embodiment, a monochrome document to be encoded is scanned at a predetermined resolution, and the scanned image data is encoded. In this case, only a portion of the document can be scanned at a resolution twice the predetermined resolution in both the horizontal and vertical directions. The predetermined resolution will be referred to as a low resolution, and the resolution twice the predetermined resolution in both the horizontal and vertical directions will be referred to as a high resolution hereinafter. Assume that the size of a monochrome document is fixed, and X and Y represent the image size obtained when the entire document is scanned at the high resolution. Also, both X and Y are multiples of 4.

[0187] The functions and operations of respective units of the image encoding apparatus according to this embodiment will be described below using FIG. 15.

[0188] Since the image encoding apparatus of this embodiment is obtained by adding the mask generator 5901 and coefficient shift unit 5902 to that of the fifth embodiment, and the functions and operations of other units are the same as those in the fifth embodiment, the operations of only the added mask generator 5901 and coefficient shift unit 5902 will be explained.

[0189] The mask generator 5901 generates and outputs mask information M(x, y) indicating if coefficients C(LL, x, y), C(LH1, x, y), C(HL1, x, y), and C(HH, x, y) of subbands obtained by decomposing C(LL, x, y) obtained by the coefficient multiplexer 5804 into subbands are associated with the high-resolution image Ph(x, y), with reference to the resolution flags Fl(lx, ly) generated by the image region discrimination unit 5802. The mask information has a size half that of the information of the resolution flags. If one of Fl(2×x, 2×y), Fl(2×x+1, 2×y), Fl(2×x, 2×y+1), and Fl(2×x+1, 2×y+1) is 1, M(x, y)=1; if all of them are zero, M(x, y)=0.

[0190] The coefficient shift unit 5902 obtains a maximum value Nmax of the numbers of effective bits of respective subbands, refers to the mask information M(x, y) generated by the mask generator 5901 in association with coefficient values C(S, x, y) of LL, LH1, HL1, and HH1 subbands, and shifts up by Nmax bits a coefficient C(S, x, y) of each subband if M(x, y)=1. Hence, upon referring to the coefficients of all the subbands, coefficients each of which has a number of effective bits equal to or larger than Nmax can be considered as those corresponding to M(x, y)=1, thus specifying a high-resolution region earlier.

[0191] After that, the processes up to the code output unit 5110 are the same as those in the fourth and fifth embodiments. In this embodiment, however, upon inserting additional information in encoded data by the code sequence forming unit 5109, the number Nmax of bits, which are shifted up by the coefficient shift unit 5902, is inserted in the header.

[0192] In this embodiment, the receiving side of the code sequence can decode text/line image information earlier in addition to the effect described in the fifth embodiment.

[0193] <Modification>

[0194] The present invention is not limited to the aforementioned embodiments. For example, in the fourth to sixth embodiments described above, encoding using discrete wavelet transformation given by equations (5) and (6) has been exemplified. However, discrete wavelet transformation is not limited to that used in the above embodiments, and the types of filters and adaptive method may be changed. For example, a filter having a large number of taps, e.g., a 9/7 filter may be used instead, and two-dimensional discrete wavelet transformation may be repetitively applied to subbands other than the low-frequency subband. In this case, the filter influence range must be taken into consideration in the coefficient multiplexing process.

[0195] The bit plane encoding method using QM-Coder has been exemplified as the coefficient encoding method. However, the present invention is not limited to the above embodiments. For example, arithmetic coding methods such as MQ-Coder and the like other than QM-Coder may be applied, and other binary coding methods such as MELCODE and the like may be applied. Also, a bit plane may be categorized into a plurality of sub-bit planes in accordance with the state of coefficients near the coefficient of interest, and may be encoded in a plurality of passes. Furthermore, Golomb coding may be applied to directly execute entropy-coding of multi-valued coefficients without decomposing them into binary data.

[0196] In the above embodiments, bit plane encoding for respective subbands has been explained for the sake of simplicity. However, each subband may be further segmented into small blocks, and bit plane encoding may be applied to each small block, so as to allow easy random access.

[0197] Upon forming the code sequence, the receiving side can reconstruct an image while gradually increasing the resolution. However, the present invention is not limited to this. For example, a code sequence may be formed by arranging coefficients in descending order of values so as to gradually improve the image quality.

[0198] Note that the present invention may be applied to either a system constituted by a plurality of devices (e.g., a host computer, interface device, reader, printer, and the like), or an apparatus consisting of a single equipment (e.g., a copying machine, facsimile apparatus, digital camera, or the like).

[0199] Also, the present invention is not limited to the system and method alone for implementing the aforementioned embodiments, but the scope of the present invention includes a case wherein the above embodiments are achieved by supplying a program code of software that can implement the functions of the above-mentioned embodiments to a computer (or a CPU or MPU) in a system or apparatus, and making the computer control various devices in the system or apparatus.

[0200] In this case, the program code itself read out from the storage medium implements the functions of the above-mentioned embodiments, and the program code itself, and means for supplying the program code to the computer (i.e., a storage medium which stores the program code) are included in the scope of the present invention.

[0201] As the storage medium for storing such program code, for example, a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, magnetic tape, nonvolatile memory card, ROM, and the like may be used.

[0202] The program is included in the scope of the embodiments not only when the functions of the above embodiments are implemented by controlling various devices according to the supplied program code alone but also when the functions of the embodiments are implemented by collaboration of the program and an OS (operating system) or another application software running on the computer.

[0203] Furthermore, the scope of the present invention includes a case wherein the functions of the above-mentioned embodiments are implemented by some or all of actual processing operations executed by a CPU or the like arranged in a function extension board or a function extension unit, which is inserted in or connected to the computer, after the supplied program code is written in a memory of the extension board or unit.

[0204] With the above description, upon encoding image data that contains regions which require different resolution levels, the present invention can achieve efficient image encoding. Also, encoding that generates a code sequence with which the resolution region of interest can be specified early upon decoding the encoded image data can be made.

[0205] As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims. 

What is claimed is:
 1. An image encoding apparatus for encoding an image, comprising: region information generation means for generating region information which indicates a region of the image, that requires decoding at a higher resolution than other regions; frequency transformation means for generating coefficients for respective subband by frequency transformation of the image; correction means for correcting, in accordance with the region information, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by said frequency transformation means or quantized values of the coefficients; and encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by said correction means to generate a code sequence.
 2. The apparatus according to claim 1, wherein the region that requires decoding at the higher resolution than other regions includes a text region.
 3. The apparatus according to claim 1, wherein said correction means generates, based on the region information, mask information indicating if the coefficients which form the subband included in the predetermined high-frequency component, or the quantized values of the coefficients are included in the region that requires decoding at the higher resolution than other regions, and corrects the coefficients or the quantized values of the coefficients in accordance with the mask information.
 4. The apparatus according to claim 3, wherein said correction means generates the mask information for respective subbands included in the predetermined high-frequency component.
 5. The apparatus according to claim 1, wherein when the coefficients which form the subband included in the predetermined high-frequency component, or the quantized values of the coefficients are not included in the region that requires decoding at the higher resolution than other regions, said correction means corrects the coefficients or the quantized values of the coefficients.
 6. The apparatus according to claim 5, wherein when the coefficients which form the subband included in the predetermined high-frequency component, or the quantized values of the coefficients are not included in the region that requires decoding at the higher resolution than other regions, said correction means corrects the coefficients or the quantized values of the coefficients to zero.
 7. The apparatus according to claim 1, wherein said frequency transformation means utilizes the discrete wavelet transforms.
 8. An image encoding apparatus for encoding an image, comprising: division means for dividing the image into tiles each having a predetermined size; frequency transformation means for generating coefficients for respective subbands of a tile, divided by said division means, by frequency transformation of the tile; discrimination means for generating a discrimination result indicating if each of the tiles divided by said division means includes a specific region; correction means for correcting, in accordance with the discrimination result of said discrimination means, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by said frequency transformation means or quantized values of the coefficients; and encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by said correction means to generate a code sequence.
 9. An image encoding apparatus for encoding an image, comprising: division means for dividing the image into tiles each having a predetermined size; discrimination means for generating a discrimination result indicating if each of the tiles divided by said division means includes a specific region; frequency transformation means for generating coefficients for respective subbands of a tile, divided by said division means, by frequency transform of the tile using a filter according to the discrimination result of said discrimination means; correction means for correcting, in accordance with the discrimination result of said discrimination means, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated by said frequency transformation means or quantized values of the coefficients; and encoding means for encoding the coefficients or quantized values of the coefficients, including those corrected coefficients by said correction means to generate a code sequence.
 10. The apparatus according to claim 8, wherein the specific region includes a text region.
 11. The apparatus according to claim 8, wherein said discrimination means generates the discrimination result on the basis of an operator's instruction that indicates the specific region.
 12. The apparatus according to claim 8, wherein said discrimination means obtains edge information of the tiles, and generates the discrimination result based on the edge information.
 13. The apparatus according to claim 8, wherein when the coefficients which form the subband included in the predetermined high-frequency component, or the quantized values of the coefficients are not included in the specific region, said correction means corrects the coefficients or the quantized values of the coefficients.
 14. The apparatus according to claim 13, wherein when the coefficients which form the subband included in the predetermined high-frequency component, or the quantized values of the coefficients are not included in the specific region, said correction means corrects the coefficients or the quantized values of the coefficients to zero.
 15. The apparatus according to claim 8, wherein said frequency transformation means utilizes the discrete wavelet transforms.
 16. The apparatus according to claim 9, wherein the code sequence includes the discrimination results for respective tiles.
 17. An image encoding method for encoding an image, comprising: the region information generation step of generating region information which indicates a region of the image, that requires decoding at a higher resolution than other regions; the frequency transformation step of generating coefficients for respective subband by frequency transformation of the image; the correction step of correcting, in accordance with the region information, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in said correction step to generate a code sequence.
 18. An image encoding method for encoding an image, comprising: the division step of dividing the image into tiles each having a predetermined size; frequency transformation step of generating coefficients for respective subbands of a tile, divided in said division step, by frequency transformation of the tile; the discrimination step of generating a discrimination result indicating if each of the tiles divided in the division step includes a specific region; the correction step of correcting, in accordance with the discrimination result of the discrimination step, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in said correction step to generate a code sequence.
 19. An image encoding method for encoding an image, comprising: the division step of dividing the image into tiles each having a predetermined size; the discrimination step of generating a discrimination result indicating if each of the tiles divided in the division step includes a specific region; the frequency transformation step of generating coefficients for respective subbands of a tile, divided in said division step, by frequency transform of the tile using a filter according to the discrimination result of said discrimination step; the correction step of correcting, in accordance with the discrimination result of the discrimination step, coefficients which form a subband included in a predetermined high-frequency component of the subbands generated in the frequency transformation step or quantized values of the coefficients; and the encoding step of encoding the coefficients or quantized values of the coefficients, including those corrected coefficients in said correction step to generate a code sequence.
 20. A program for making a computer execute an image encoding method of claim
 17. 21. A program for making a computer execute an image encoding method of claim
 18. 22. A program for making a computer execute an image encoding method of claim
 19. 23. A storage medium storing a program of claim
 20. 24. A storage medium storing a program of claim
 21. 25. A storage medium storing a program of claim
 22. 26. An image encoding apparatus for encoding an image, comprising: first scan means for scanning a first region of an original image at a first resolution to generate a first image including the scanned region; second scan means for scanning a second region different from the first region at a second resolution higher than the first resolution to generate a second image including the scanned region; first frequency transformation means for generating coefficients for respective subbands, by frequency transformation of the second image; multiplexing means for multiplexing the first image in a predetermined one of a plurality of subbands obtained by said first frequency transformation means to generate a multiplexed subband; second frequency transformation means for further generating coefficients for respective subbands, by frequency transformation of the multiplexed subband; and code sequence generation means for generating a code sequence on the basis of the coefficients of the subbands obtained by said first and second frequency transformation means.
 27. The apparatus according to claim 26, further comprising flag generation means for generating a flag used to designate a region to be scanned by said second scan means.
 28. The apparatus according to claim 27, wherein said first scan means scans a region other than the region to be scanned by said second scan means at the first resolution with reference to the flag to generate the first image.
 29. The apparatus according to claim 26, wherein a size of the first image is equal to a size of the predetermined subband.
 30. The apparatus according to claim 26, wherein the first resolution is half the second resolution.
 31. The apparatus according to claim 27, wherein said multiplexing means specifies coefficients of the predetermined subband, which are included in a region corresponding to the first region, using the flag, and replaces the specified coefficients by the first image.
 32. The apparatus according to claim 26, further comprising flag generation means for generating a flag which indicates a predetermined region in the first image.
 33. The apparatus according to claim 32, wherein the predetermined region is a text/line image region.
 34. The apparatus according to claim 32, wherein said second scan means scans the predetermined region in the original image at the second resolution with reference to the flag to generate the second image.
 35. The apparatus according to claim 32, wherein a size of the first image is equal to a size of the predetermined subband.
 36. The apparatus according to claim 32, wherein the first resolution is half the second resolution.
 37. The apparatus according to claim 32, wherein said multiplexing means specifies coefficients of the predetermined subband, which are included in a region corresponding to the first region, using the flag, and replaces the specified coefficients by the first image.
 38. The apparatus according to claim 32, further comprising mask generation means for generating a mask which indicates coefficients, associated with the second image, of the coefficients which form subbands generated upon computing the frequency transforms of the multiplexed subband by said code sequence generation means.
 39. The apparatus according to claim 38, wherein said mask generation means specifies the coefficients associated with the second image using the flag.
 40. The apparatus according to claim 26, wherein said code sequence generation means obtains a maximum value of the numbers of effective bits contained in the respective subbands generated by said code sequence generation means, and shifts up the coefficients associated with the second image by bits corresponding to the maximum value.
 41. The apparatus according to claim 40, wherein the code sequence contains the maximum value.
 42. The apparatus according to claim 26, wherein said first and second frequency transformation means utilizes the discrete wavelet transforms.
 43. The apparatus according to claim 26, wherein the predetermined subband is an LL subband.
 44. An image encoding method for encoding an image, comprising: the first scan step of scanning a first region of an original image at a first resolution to generate a first image including the scanned region; the second scan step of scanning a second region different from the first region at a second resolution higher than the first resolution to generate a second image including the scanned region; the first frequency transformation step of generating coefficients for respective subbands, by frequency transformation of the second image; the multiplexing step of multiplexing the first image in a predetermined one of a plurality of subbands obtained in the first frequency transformation step to generate a multiplexed subband; the second frequency transformation step of further generating coefficients for respective subbands, by frequency transformation of the multiplexed subband; and the code sequence generation step of generating a code sequence on the basis of the coefficients of the subbands obtained in the first and second frequency transformation steps.
 45. The method according to claim 44, further comprising the flag generation step of generating a flag used to designate a region to be scanned in the second scan step.
 46. The method according to claim 44, further comprising the flag generation step of generating a flag which indicates a predetermined region in the first image.
 47. The method according to claim 46, further comprising the mask generation step of generating a mask which indicates coefficients, associated with the second image, of the coefficients which form subbands generated upon computing the frequency transforms of the multiplexed subband in the code sequence generation step.
 48. A program for making a computer execute an image encoding method of claim
 44. 49. A storage medium storing a program of claim
 48. 